<?php

namespace Mouta\AmistateBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Mouta\AmistateBundle\Entity\Denuncia;

class DenunciaType extends AbstractType
{
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
			->add('motivo','choice', array(
				'choices'   => Denuncia::getMotivos(),
				'required'  => false,
			))
            ->add('mensaje','textarea', array('required' => true, 'attr' => array(
                    'cols' => 90,
                    'rows' => 10,
                    'placeholder' => 'Mensaje'
                )  ))
				
            ->add('tipo','hidden')
            //->add('denunciante', 'hidden', array('property_path' => 'denunciante.id'))
            ->add('extra','hidden')
            //->add('infractor', 'hidden', array('property_path' => 'infractor.id'))
        ;
    }
    
    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Mouta\AmistateBundle\Entity\Denuncia'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'mouta_amistatebundle_denuncia';
    }
}
